package com.demo.rabbitmq;

import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.messaging.Message;

import java.util.Date;

@Slf4j

@EnableBinding({MyMessageChannel.class})
public class SmsConsumer {

    @StreamListener(MyMessageChannel.in)
    public void saveOrderMessage(Message<String> message) {
        log.info("开始时间{}，消息发送成功：{}",new Date(),message.getPayload());
    }
}
